<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/bootstrap.min.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/jedate.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/fonts/iconfont.css"/>
		<link rel="stylesheet" type="text/css" href="../../../resource/css/common.css"/>
		<link rel="stylesheet" type="text/css" href="../../../../resources/layui/css/layui.css"/>

	</head>
	<body>
		<div class="container-fluid">
			<div class="row mheader">
				<div class="col-xs-2 text-left"> <a href="javascript:;" onclick="location.href='../../../word.html'"><span class="iconfont icon-fanhui"></span></a> </div>
				<div class="col-xs-8"><h2>工程材料需求申请单</h2></div>
				<div class="col-xs-2 text-right"><a href="#"><span class="iconfont icon-31sousuo sousuo"></span></a></div>
			</div>
			<div class="row">
				<dl class="erp-list" id="list">

				</dl>
				<div style="margin-bottom: 80px;"></div>
				<div class="order-send"><a href="material-apply.html" class="btn btn-warning">申请材料</a></div>

			</div>
			<!--搜索-->
			<div class="search-box">
				<div class="search-cover">
					<form action="" method="post">
						<div class="row">
							<div class="col-xs-4">
								<ul class="list-group list-items">
								  <li class="list-group-item list-group-lists search-active">项目名称</li>
								  <li class="list-group-item list-group-lists">开始时间</li>
								  <li class="list-group-item list-group-lists">结束时间</li>
								</ul>
							</div>
							<div class="col-xs-8">
								<div class="search-lists search-list1 search-active">
									<input type="text" class="pro pro-input pro-name" placeholder="请输入项目名称"/>
								</div>
								<div class="search-lists search-active">
									<input type="text" class="layui-input" id="test01" name="begintime" placeholder="请输入开始时间">
								</div>
								<div class="search-lists search-active">
									<input type="text" class="layui-input" id="test02" name="begintime" placeholder="请输入结束时间">
								</div>
							</div>
						</div>
						<div class="row">
							<span class="btns close-cover">取消</span>
							<input class="sub-cover btns fr" type="button" value="确定"/>
							
						</div>
						
					</form>
				</div>
			</div>
		</div>
	</body>
</html>
<script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
<script src="../../../resource/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../resource/js/jquery.jedate.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../resource/js/style.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../resources/js/template-web.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../resources/layui/layui.js"></script>

<script id="m_list" type="text/html">
	{{each data as value i}}
		<dd>
			<a href="#" onclick="loadDetails('{{value.proName}}','{{value.compName1}}','{{value.supply_Time}}','{{value.feed_sqr}}','{{value.state==0?"已审核":"等待审核"}}','{{value.feed_Code}}','{{value.f_adr}}')">
				<h3>
					{{value.feed_Code}}
					<span class="btn btn-danger fr">{{value.state==0?"已审核":"等待审核"}}</span>
				</h3>
				<div class="erp-txt visa-txt">
					<p><span class="sp">工程名称:</span><span class="divCon">{{value.proName}}</span></p>
					<p><span class="sp">施工单位:</span><span class="divCon">{{value.compName1}}</span></p>
					<p><span class="sp">申请人:</span><span class="divCon">{{value.feed_sqr}}</span></p>
					<p><span class="sp">收货地址:</span><span class="divCon">{{value.f_adr}}</span></p>
					<p><span>供货时间:</span>{{value.supply_Time}}</p>
					<p><span>创建时间:</span>{{value.createTime}}</p>
				</div>
			</a>
		</dd>
	{{/each}}
</script>
<script>


    var formData = {
        type:'a',
        proName:'',
        begintime:'',
        endtime:'',
    };
    //滚动加载
    var nloader = LoadMore({
        api: 'api/material/loadMatFeedPic.do',
        data: formData,
        success: function (data) {
            var html = template('m_list', data);
//            document.getElementById('list').innerHTML =  html;
            $("#list").html( $("#list").html() + html);

        }
    })

    layui.use(['form', 'layedit', 'laydate','table','laytpl','flow'], function() {
        var laydate = layui.laydate;

        laydate.render({
            elem: '#test01'
            ,type: 'datetime'
        });
        laydate.render({
            elem: '#test02'
            ,type: 'datetime'
        });
    })

    /**
	 *  加载详情
     * @param proName 项目名称
     * @param compName1	施工单位名称
     * @param supply_Time	供货时间
     * @param feed_sqr	申请人
     * @param state	审核状态
     */
    function loadDetails(proName,compName1,supply_Time,feed_sqr,state,feed_code,f_adr) {
        var obj = {};
        obj.proName = proName;
        obj.compName1 = compName1;
        obj.supply_Time = supply_Time;
        obj.feed_sqr = feed_sqr;
        obj.state = state;
        obj.feed_code = feed_code;
        obj.f_adr = f_adr;
        sessionStorage.setItem("obj",JSON.stringify(obj));
        //进入详情


        	location.href="./material-details.html";

    }


	$(".sousuo").click(function(){
		$(".search-box").slideToggle();
	})
	$(".list-group-lists").click(function(){
		var i=$(this).index();
		$(".search-lists").hide();
		$(".search-lists").eq(i).show();
		$(".list-group-lists").removeClass("search-active");
		$(this).addClass("search-active");
		$(".pros").hide();
		$(".pros").eq(i).show();

	});

//	点击取消按钮
	$(".close-cover").click(function(){
		$(".search-box").slideUp();
	});
//	点击确定按钮
	$(".sub-cover").click(function(){
        $("#list").html('');

        $(".search-box").slideUp();
        formData.proName=$('.pro').val();
        formData.begintime=$('#test01').val();
        formData.endtime = $('#test02').val();
        nloader.search();
	});
</script>










